import wepy from 'wepy';
const wxRequest = async (params={},url)=>{
    let data =params || {};
    
  return new Promise((resolve, reject) => {
    wepy.request({
        url: url,
        method: params.method || 'GET',
        data: data,
        header: { 'Content-Type': 'application/json' },
        success: resolve,
        fail: reject
    });
  })
    // let res = await wepy.request({
    //     url: url,
    //     method: params.method || 'GET',
    //     data: data,
    //     header: { 'Content-Type': 'application/json' },
    // });
    // debugger
    // return res;
    
}

module.exports = {
    wxRequest
}